package com.techfansy.provinceCitySelect.adapter;


import java.util.List;

/**
 * Numeric Wheel adapter.
 */
public class NumericWheelAdapter implements WheelAdapter {
	private List<String> list;
	/** The default min value */
	public static final int DEFAULT_MAX_VALUE = 9;

	/** The default max value */
	private static final int DEFAULT_MIN_VALUE = 0;
	
	// Values
	private int minValue;
	private int maxValue;

	/**
	 * Default constructor
	 */


	/**
	 * Constructor
	 * @param minValue the wheel min value
	 * @param maxValue the wheel max value
	 */
	public NumericWheelAdapter(List<String> list) {
		this.list =list;

	}

	@Override
	public Object getItem(int index) {
		Object value = null;
		if (index >= 0 && index < getItemsCount()) {
		 value = list.get(index);
			return value;
		}
		return value;
	}

	@Override
	public int getItemsCount() {
		return list.size();
	}
	
	@Override
	public int indexOf(Object o){
		try {
			return list.indexOf(o);
		} catch (Exception e) {
			return -1;
		}

	}
}
